package com.atldy.commerce.feign;

import com.atldy.commerce.account.AddressInfo;
import com.atldy.commerce.account.AddressItemVo;
import com.atldy.commerce.commence.Id;
import com.atldy.commerce.commence.TableId;
import com.atldy.commerce.feign.hystrix.SecureAddressHystrix;
import com.atldy.commerce.vo.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * <h2> 用户地址feign 接口 </h2>
 *
 * @Author: li-dong-yang
 * @CreateTime: 2021-11-04 22:29
 */
@FeignClient(contextId = "SecureAddressClient"
        , value = "e-commerce-service-account"
        , fallback = SecureAddressHystrix.class)
public interface SecureAddressClient {


    /**
     * <p>根据地址主键id集合获取用户地址信息列表</p>
     *
     * @date: 2021/11/4 22:36
     * @param: [tableId]
     */
    @PostMapping("/ecommerce-service-account/address/selectByUserId")
    CommonResponse<AddressInfo> getAddressInfoByIds(TableId tableId);

    /**
     * <p>根据当前用户id获取用户地址信息列表</p>
     *
     * @date: 2021/11/4 22:35
     * @param: []
     */
    @PostMapping("/ecommerce-service-account/address/getCurrentUserAddressInfo")
    CommonResponse<AddressInfo> getCurrentUserAddressInfo();

    /**
     * <p>根据地址主键id获取用户地址信息</p>
     *
     * @date: 2021/11/4 22:35
     * @param: [id]
     */
    @PostMapping("/ecommerce-service-account/address/getAddressInfoById")
    CommonResponse<AddressItemVo> getAddressInfoById(@RequestBody Id id);


}